package com.esd.db.service;

import java.util.List;
import java.util.Map;

import com.esd.db.model.AlipayInfo;
import com.esd.db.model.salary;

public interface SalaryService {
    int deleteByPrimaryKey(Integer id);

    int insert(salary record);

    int insertSelective(salary record);

    salary getByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(salary record);

    int updateByPrimaryKey(salary record);
    
    AlipayInfo insertTimer(int workerId,String uploadUUID);
    
    List<Map<String,Object>> getSalary(int dateType,int page,int row,String beginDate,String endDate,String realName,int salaryLine,int payOffType,String workGroupCode);
    
    int getSalary100Count(int dateType,String beginDate,String endDate,String realName,int salaryLine,int payOffType,String workGroupCode);
    
    Double getSUMSalary(int dateType,String beginDate,String endDate,String realName,int salaryLine,int payOffType);
    
    List<Map<String,Object>> getWorkerSalaryByWorkerId(int workerId);
    
    List<Map<String, Object>> getMoneyList(String beginDate,String endDate,String month);

    Double getSumMarkTime2(int workerId,String nowMonth);
    
    int insertPayOffInfor(int dateType,String beginDate,String endDate,String realName,int salaryLine,String payOffTime);
    
    int insertPayOffInfor1(int dateType,String beginDate,String endDate,String workerId[],String payOffTime);
    
    Double getMoneyTotle(int today);

	AlipayInfo insertSalary(int workerId,int packId);

	AlipayInfo insertSalaryForQuickInspection(int workerId, int packId);
	
	/**
	 *  获取工作组列表的 标注时间和工作组编号
	 * @param dateType
	 * @param page
	 * @param row
	 * @param beginDate
	 * @param endDate
	 * @param workGroupNameCondition
	 * @return
	 */
	List<Map<String, Object>> getWorkGroupCodeAndSumMarkTimeList(int dateType, int page, int row, String beginDate, String endDate, String workGroupNameCondition);
	
	/**
	 * 工作组列表分页总数
	 * @param dateType
	 * @param beginDate
	 * @param endDate
	 * @param workGroupNameCondition
	 * @return
	 */
	int getWorkGroupListCount(int dateType, String beginDate, String endDate, String workGroupNameCondition);
	
	/**
	 * 巡审合格时插入工资表数据
	 * @param insDate
	 * @return
	 */
	List<AlipayInfo> insertSalaryForInspByDay(String insDate, String searchTime, String workGroupCode, List<Integer> recordIds);
	
	/**
	 * 减去被巡审退回任务的审核标注时间  
	 * @param workerIds  审核不合格时页面传过来选中的被退回任务的workerid
	 * @param insDate   巡审时间
	 * @return 
	 */
	int subtractFromSalaryForInspByDay(int[] workerIds, String searchTime, String insDate);
	
	/**
	 * 减去被包审退回任务的审核标注时间   
	 * @param workerIds  审核不合格时页面传过来选中的被退回任务的workerid
	 * @param packId   包id
	 * @return 
	 */
	int subtractFromSalaryForInspByPackage(int[] workerIds, int packId, int sendBackType, int[] unqualifiedTaskIds);
	
	/**
	 * 减去被包审退回任务的审核标注时间   
	 * @param workerIds  审核不合格时页面传过来选中的被退回任务的workerid
	 * @param packId   包id
	 * @return 
	 */
	int subtractFromSalaryForQuickInspection(int[] workerIds, int packId);
	
	/**
	 * 修改自原来的getSUMSalary方法 新方法中区分了工作组
	 * @return
	 */
	List<Map<String, Object>> getWorkGroupAndSumMarkTime(int dateType,
			String beginDate, String endDate, String userNameCondition,
			int salaryLine, int payOffType);
	
	/**
	 * 计算全部工资和标注时间  代替getSUMSalary方法
	 */
	Map<String, Object> getTotleHoursAndTotleMoney(int dateType,
			String beginDate, String endDate, String userNameCondition,
			int salaryLine, int payOffType);
	
	/**
	 * 查询被推荐人用   查找工作者的月工作时间和金额
	 * @param workerId  工作者id
	 * @param date  查询日期条件  格式为  "yyyy-MM-dd"
	 * @return  Map<String, Object>  key为  markTime和salaryValue
	 */
	Map<String, Object> getSumMarkTimeAndSalaryValueForViewOfReferrals(int workerId, String date);
	
	/**
	 * 巡审审核初审修改过的任务合格时插入工资表数据
	 * @param insDate
	 * @return
	 */
	List<AlipayInfo> insertSalaryForModifyCompleted(List<Integer> recordIds);
	
	/**
	 * 根据workerId获取工作者1层和3层任务的工资
	 * @param workerId
	 * @param dateType
	 * @param beginDate
	 * @param endDate
	 * @param payOffType
	 * @return
	 */
	List<Map<String, Object>> getSalaryOfOneLayerAndThreelayerByWorkerId(int workerId, int dateType, String beginDate,
			String endDate, int payOffType);
}

